package com.yc.thread.pro3_bestMatching;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * @author zwei
 * @create 2024-07-25 15:55
 */
public class TestMain2 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        String path = System.getProperty("user.home") + "//word.txt";
        List<String> list = WorldsLoader.load(path);
        System.out.println("词汇总量"+list.size());
        Date strt= new Date();
        String word = "gs";
        BestMatchingData result=BestMatchingConcurrentCalculation.getBestMatchingWords(word,list);
        Date end= new Date();
        int minDistance=result.getDistance();
        List<String>wordlist=result.getWords();
        System.out.println("最短编辑距离"+minDistance);
        for (String s:wordlist){
            System.out.println(s+"\t");
        }
        System.out.println("执行时间为："+(end.getTime()-strt.getTime()));
    }
}

